package com.hnust.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnust.entity.SensorData;
import com.hnust.entity.code.SensorCode;
import com.hnust.entity.dto.DeviceDto;
import com.hnust.service.MonitorService;
import com.hnust.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@CrossOrigin("*")
@RequestMapping("/monitor")
public class MonitorController {

    @Autowired
    private MonitorService monitorService;

    @GetMapping("/show")
    public R<Page<SensorCode>> MonitorSearch(Integer page,Integer pageSize) {
        log.info("调用搜索设备接口:page:{},pageSize:{}",
                page, pageSize);
        Page<SensorCode> pageInfo = monitorService.MonitorSearch(page, pageSize);
        return R.success(pageInfo);
    }
}
